package com.dianxin.smartpark.service.config;

public enum MqttReceiveType {


    /**
     * 操作类型
     */
    CLIENTOPT("$SYS/brokers/","设备监控"),
    ONLINE("connected","设备上线"),
    DISONLINE("disconnected","设备离线");


    private final String optNmae;
    private final String optCode;


    MqttReceiveType(String optCode, String optNmae) {
        this.optNmae = optNmae;
        this.optCode = optCode;
    }

    public String getOptNmae() {
        return optNmae;
    }

    public String getOptCode() {
        return optCode;
    }

    public static String mqttOptType(String optNmae) {
        if (optNmae == null) {
            return null;
        }
        for (MqttReceiveType value : MqttReceiveType.values()) {

            if (value.optNmae.equals(optNmae)) {
                return value.optCode;
            }
        }
        return null;
    }


}
